import request from '@/utils/request'
import Qs from 'qs'

export function login(username, password, code, uuid) {
  return request({
    // url: 'auth/login',
    url: 'sys/login/rest',
    method: 'post',
    data: Qs.stringify( {
      username,
      password,
      code,
      uuid
    } )
  })
}

export function getInfo() {
  return request({
    // url: 'auth/info',
    url: 'sys/login/info',
    method: 'get'
  })
}

export function getCodeImg() {
  return request({
    // url: 'auth/code',
    url: 'sys/auth/code',
    method: 'get'
  })
}

export function logout() {
  return request({
    url: 'auth/logout',
    method: 'delete'
  })
}
